class Solution {
public:
    int maxArea(vector<int>& height) {
        int left=0;
        int right=height.size()-1;
        int ret=-1e5;
        while(left<=right-1)//注意不能让他们两个相等
        {
            int h=min(height[left],height[right]);
            ret=max(ret,h*(right-left));
            if(height[left]<height[right])
            {
                left++;
            }
            else right--;
        }
        return ret;
    }
};